// 884. 两句话中的不常见单词
/**
 * @param {string} s1
 * @param {string} s2
 * @return {string[]}
 */
var uncommonFromSentences = function (s1, s2) {
    const a1 = s1.split(" ")
    const a2 = s2.split(" ")
    const map = new Map()
    const result = []
    for (let i = 0; i < a1.length; i++) {
        map.set(a1[i], map.get(a1[i]) + 1 || 1)
    }
    for (let i = 0; i < a2.length; i++) {
        map.set(a2[i], map.get(a2[i]) + 1 || 1)
    }
    for (const [v1, v2] of map) {
        if (v2 === 1) {
            result.push(v1)
        }
    }
    return result
};

const result = uncommonFromSentences("apple apple", "banana")